<!--{template ADMIN_DIRECTORY/tpl/admin_header}-->

<style type="text/css">
	table tr .t_r{text-align:right}
</style>
<div class="page_title">
  <h1>{$model_info['model_name']}{$_lang['task_config']}</h1>
    <div class="tool">
      <a href="index.php?do={$do}&model_id={$model_id}&view={$view}&op=config">{$_lang['basic_config']}</a>
      <a href="index.php?do={$do}&model_id={$model_id}&view={$view}&op=control" class="here">{$_lang['control_config']}</a>
      <a href="index.php?do={$do}&model_id={$model_id}&view={$view}&op=priv">{$_lang['private_config']}</a>
      <a href="index.php?do=custom&view=fields&model_id={$model_id}">自定义输入字段</a>
    </div>
</div>
<div class="box post">
<div class="tabcon">
 <div class="title"><h2>{$_lang['control_config']}</h2></div>
 
  <form name="frm_config_reward" action="{$ac_url}" method="post" id="frm_config_reward">
  <input type="hidden" name="pk[model_id]" value="{$model_id}">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
  	
	<tr>
		 <th scope="row" width="200"> <b>{$_lang['task_conmission_tactic']}</b>{$_lang['zh_mh']}{$_lang['task_rule_and_money_set']}
</th><td>&nbsp;</td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['task_auditing_cash_set']}{$_lang['zh_mh']}</th>
		 <td>
			<input type="text" size="10"   name="conf[audit_cash]" id="audit_cash" value="{$audit_cash}"  limit="required:true;type:float;between:0-" msg="{$_lang['txt_task_auditing_cash_msg']}" title="{$_lang['txt_task_auditing_cash_title']}" msgArea="audit_moeny_msg"  class="txt"> {$_lang['yuan']}
				{$_lang['task_cash_notice']}<span id="audit_moeny_msg"></span>
		</td>
    </tr>
	<tr>
		<th scope="row" width="200" class="t_r">任务最大金额设定{$_lang['zh_mh']}</th>
		 <td>
			<input type="text" size="10"   name="conf[max_cash]" id="max_cash" value="<!--{eval echo floatval($max_cash);}-->" limit="type:float;required:true;between:0-" msg="设置任务最大金额"  msgArea="task_max_cash_msg" class="txt"/>{$_lang['yuan']}
			(设置任务最大金额,为0时不生效)<span id="task_max_cash_msg"></span>
		 </td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">{$_lang['set_task_min_cash']}{$_lang['zh_mh']}</th>
		 <td>
			<input type="text" size="10"   name="conf[min_cash]" id="min_cash" value="{if $min_cash}{$min_cash}{else}1{/if}" limit="type:float;required:true;between:0-" msg=" {$_lang['task_min_cash_msg']}" title="{$_lang['task_min_cash_title']}"  msgArea="task_min_cash_msg" class="txt"/>{$_lang['yuan']}
			(设置任务最小金额不得小于0元)<span id="task_min_cash_msg"></span>
		 </td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">最小福袋数量</th> 
		<td>
			<input type="text" size="10" name="conf[min_num]" value="{$min_num}" id="min_red" limit="required:true;type:int;len:1-3;between:0-100" msg="{$_lang['task_deduct_rate_msg']}" title="{$_lang['task_deduct_rate_title']}" msgArea="deduct_scale_msg" class="txt"/>个（设置任务福袋不能小于一个）<span id="deduct_scale_msg"></span>
		</td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">最大福袋数量</th> 
		<td>
			<input type="text" size="10" name="conf[max_num]" id="max_num" value="{$max_num}" limit="required:true;type:int;len:1-3;between:0-100" msg="{$_lang['fail_task_deduct_rate_msg']}" title="{$_lang['fail_task_deduct_rate_title']}" msgArea="fail_rate_msg" class="txt"/>个（设置任务福袋不能大于X个）<span id="fail_rate_msg"></span>
		</td>
	</tr>
	
    
  	<tr><th scope="row" width="200">任务最大时间限制：任务交易时间规则</th><td>&nbsp;</td></tr>
	<tr>
		<th scope="row" width="200" class="t_r">任务最大时间限制：</th>
		 <td>
			<input type="text" size="10" id="max_time"  name="conf[max_time]"  value="{$max_time}" limit="type:int;required:true;between:0-" msg="{$_lang['task_public_time_msg']}" title="{$_lang['task_public_time_title']}" msgArea="span_notice_period" class="txt">（任务上限时间,需大于最小时间限制）
			<span id="span_notice_period"></span>
		 </td>
	</tr>
	<tr>
		<th scope="row" width="200" class="t_r">任务最小时间限制：</th>
		 <td>
			<input type="text" size="10" id="min_time"  name="conf[min_time]"  value="{$min_time}" limit="type:int;required:true;between:1-" msg="{$_lang['task_min_day_msg']}" title="{$_lang['task_min_day_title']}" msgArea="span_min_day" class="txt">（任务下下限时间,需小于最大时间限制）
			<span id="span_min_day"></span>
		 </td>
	</tr>
	
	<tr>
		<th scope="row" width="200">&nbsp;</th>
		<td>
            <div class="clearfix padt10">
            <input type="hidden" name="sbt_edit" value="1">
			 <button type="button" name="sbt_edit" class="positive primary  button" value="1" onclick="confirm_sub()"><span class="check icon"></span>{$_lang['submit']}</button>
			</div>
		</td>
	</tr>
  </table>
  </form>
   </div>
 </div>
<script type="text/javascript">

$(function(){
		
	if($("#end_action_1").attr("checked")==true){
		$("#slt").hide();
		$("#slt_choose_rule").hide();
	}
	if($("#end_action_2").attr("checked")==true){
		 $("#slt").show();
		  $("#slt_choose_rule").show();
	 }
	$("#end_action_1").click(function(){
		$("#slt").hide();
		$("#slt_choose_rule").hide();
	})
	$("#end_action_2").click(function(){
		  $("#slt").show();
		 $("#slt_choose_rule").show();
	})
	
	$("#add_time_rule").click(function(){
		var ruleNum=parseInt($("#add_new_rul").find("li").length)+1;
		var newRule=$("<li><span id='span_"+ruleNum+"'>"+ruleNum+"</span><input type='text' size='10' name='timeNew["+ruleNum+"][rule_cash]' class='txt'/>元以上 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
				 "&nbsp;&nbsp;<input type='text' size='10' name='timeNew["+ruleNum+"][rule_day]' class='txt'> 天<br></li>");
			newRule.appendTo($("#add_new_rul"));
	})	
	$(".del_time_rule").click(function(){
		var timeRuleId=parseInt($(this).attr("rel"));
			if(!isNaN(timeRuleId)){
				$.getJSON("{$ac_url}",{ac:'del_time_rule',rule_id:timeRuleId},function(){});
			}
		$(this).parent().remove();
	})	
	$("#add_delay_rule").click(function(){
		var delayNum=parseInt($("#new_delay_rule").find("li").length)+1;
		var newRule=$("<li>{$_lang['di']}<input type='text' size='10' name='delayNew["+delayNum+"][defer_times]' value="+delayNum+" class='txt'/>{$_lang['times']}"+
				 "{$_lang['delay_rule_notice']}&nbsp;<input type='text' size='10' name='delayNew["+delayNum+"][defer_rate]' class='txt'>%"+
				 "</li>");
			newRule.appendTo($("#new_delay_rule"));
	})
	$(".del_delay_rule").click(function(){
		var delayRuleId=parseInt($(this).attr("rel"));
			if(!isNaN(delayRuleId)){
				$.getJSON("{$ac_url}",{ac:'del_delay_rule',rule_id:delayRuleId},function(){});
			}
		$(this).parent().remove();
	})
  })
  function confirm_sub(){
  	var i = checkForm(document.getElementById('frm_config_reward'));
	if(i){
		$("#frm_config_reward").submit();
	}else{
		return false;
	}
  }
</script>
<!--{template ADMIN_DIRECTORY/tpl/admin_footer}-->